package com.yu.controller;


import com.yu.model.Result;
import com.yu.model.dto.PatientDTO;
import com.yu.model.vo.PatientPlan;
import com.yu.service.PatientService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@Api(tags = "病人相关接口")
@RequestMapping("/patient")
public class PatientController {

    @Resource
    private PatientService patientService;



    @PostMapping("/login")
    @ApiOperation(value = "病人登录")
    public Result<String> login(PatientDTO patientDTO){
        return patientService.login(patientDTO);
    }



    @GetMapping("/exercise")
    @ApiOperation(value = "病人查看今天的全部计划")
    public Result<PatientPlan> listExercise(){
        return Result.success(patientService.listExercise());
    }

}
